package com.order.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.order.common.R;
import com.order.po.b_size;
import com.order.po.b_stock;
import com.order.service.stockService;

@Controller
public class stockController {

	 @Autowired
	  private stockService stockService;
	 
	 @RequestMapping({"/getAllstock"})
	   @ResponseBody
	   public R getAllstock()
	   {
		 R r = R.ok().put("data", this.stockService.getAllstock());
	     return r;
	   }
	 
	 @RequestMapping({"/get_bystockgoodsid"})
	   @ResponseBody
	   public R get_bystockgoodsid(String parameter)
	   {
		 R ri = R.ok().put("data", this.stockService.get_bystockgoodsid(parameter));
	     return ri;
	   }
	 
	 @RequestMapping({"/get_stockgoodsid"})
	   @ResponseBody
	   public R get_stockgoodsid(String parameter)
	   {
		 R ri = R.ok().put("data", this.stockService.get_stockgoodsid(parameter));
	     return ri;
	   }
	 
	  @RequestMapping({ "/insert_stock" })
		@ResponseBody
		public void insert_stock(b_stock s) {
			 this.stockService.insert_stock(s);
		 }
	  
	  @RequestMapping({ "/delete_stock" })
		@ResponseBody
		public void delete_stock(String ykey) {
			this.stockService.delete_stock(ykey);
		 }	
}
